package com.example.vae.Dao.PersonData;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.example.vae.Pojo.Person;

//这个是初始化关于 个人信息的的Room 数据库
@Database(entities = {Person.class},version = 1,exportSchema = false)
public abstract class PersonDatabase extends RoomDatabase {

//    实例化的 Room
    private  static  PersonDatabase INSTANCE;
    public static synchronized PersonDatabase getDatabase(Context context){
        if(INSTANCE==null){
            INSTANCE= Room.databaseBuilder(context.getApplicationContext(),PersonDatabase.class,"person_database").build();
        }
        return INSTANCE;
    }
    public abstract PersonDao getpersonDao();
}
